#ifndef D_CAMERA_H
#define D_CAMERA_H

#include <iostream>
#include <helpers\math\delge_math.h>
#include <modules\graphics\color.h>
#include <modules\graphics\transformable.h>

using namespace std;
using namespace DelGE::Helpers::Math;
using namespace DelGE::Modules::Graphics;

namespace DelGE
{
	namespace Modules
	{
		namespace Graphics
		{
			class Camera : public Transformable
			{
			private:
				int iViewportX, iViewportY;
				int iViewportWidth, iViewportHeight;

				Color oBackgroundColor;
				Matrix oProjection;

			public:
				Camera(int iX, int iY, int iWidth, int iHeight);
				~Camera();

				void SetOrthographicProjection(float fLeft, float fRight, float fTop, float fBottom, float fNear, float fFar);
				void SetPerspectiveProjection(float fFieldOfView, float fAspect, float fNear, float fFar);

				void SetViewport(int iX, int iY, int iWidth, int iHeight);
				int GetViewportX();
				int GetViewportY();
				int GetViewportWidth();
				int GetViewportHeight();

				void SetBackgroundColor(const Color& rColor);
				Color GetBackgroundColor();

				Vector3 Project2D(const Vector3& rVector, int iScreenWidth, int iScreenHeight);

				Matrix GetProjectionMatrix();
				Frustum GetFrustum();
			};
		}
	}
}

#endif